#if !defined(ximera_common_utils_hpp)
#define ximera_common_utils_hpp

// -----------------------------------------------------------

#include <ximera/types.hpp>

#include <algorithm>
#include <string>
#include <cstdlib>

namespace ximera
{
    template <typename Type>
    inline void safe_delete(Type& x);

    template <typename Type>
    inline void safe_delete_array(Type& x);

    template <typename ContainerType>
    inline void safe_delete_clear(ContainerType& container);

    template <typename Type>
    inline void safe_release(Type& x);

    template <typename ContainerType>
    inline void safe_release_clear(ContainerType& container);

    namespace string_util
    {
        inline std::string wstr2str(std::wstring const& ws);
        inline std::wstring str2wstr(std::string const& mbs);

        inline void wstr2str(std::wstring const& ws, std::string& mbs);
        inline void str2wstr(std::string const& mbs, std::wstring& ws);
    }
}

// -----------------------------------------------------------

#include <ximera/common/inline/utils.inl>

#endif
